<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="detailData.bannerImg" alt="" />
      <div class="banner-info">
        <span class="banner-num"><span class="iconfont banner-icon">&#xe63c;</span>39</span>
        <div class="banner-title">{{detailData.sightName}}</div>
      </div>
    </div>
    <fade-animation>
      <gallary v-show="showGallary" @closeGallary="closeGallary"></gallary>
    </fade-animation>
  </div>
</template>

<script>
  import Gallary from '@Com/gallary/gallary'
  import fadeAnimation from '@Com/fade/FadeAnimation'
  export default {
    name: 'DetailBanner',
    props: {
      detailData: Object
    },
    data (){
      return {
        showGallary: false
      }
    },
    methods: {
      handleBannerClick (){
        this.showGallary = true
      },
      closeGallary (){
        this.showGallary = false
      }
    },
    components: {
      Gallary,
      fadeAnimation
    }
  }
</script>

<style lang="stylus" scoped>
  .banner
    overflow: hidden
    height: 0
    padding-bottom: 55%
    position: relative
    .banner-img
      width: 100%
    .banner-info
      width: 100%
      position: absolute
      bottom: 0
      left: 0
      color: #fff
      padding: .1rem
      background-image: linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0, .7))
      .banner-num
        line-height: .4rem
        height: .4rem
        border-radius: .2rem
        background: rgba(0, 0, 0, .6)
        padding: 0 .3rem
        font-size: .24rem
      .banner-icon
        font-size: .24rem
      .banner-title
        font-size: .42rem
        margin-top: .1rem
</style>
